import request from "@/utils/request"

/* 凭证 */

export interface findProof{
    certificateDateStart?:string,//开始时间
    certificateDateEnd?:string,//结束时间
    subId?:number, //科目Id
    makeCertificatePerson?:string,//制表人
    certificateNumberStart?:number | null,//凭证号开始
    certificateNumberEnd?:number | null,//凭证号结束
    journalSummary?:string,//备注
    pageNo?:number,
    pageSize?:number
}
const findProofList = async(_data:findProof)=>{
    const {data,code} = await request.post('/certificate/findCertificateJournalList',_data)
    if (code === 200) {
        return data
    }
    return []
}


export interface proof {
    id?: number;
    check?:number;
    red?:number;
    finish?:number;
    date?: string;
    fontNum?: string;
    moreFile?: number;
    state?: number;
    keyWord?: string[];
    proName?: string[];
    getMoney?: number[];
    sendMoney?: number[];
  }
const addProof = async(_data:proof)=>{
  const {data,code} = await request.post('/certificate/addCredential',_data);
    if (code === 200) {
        return data
    }
    return undefined
}
export interface clickId{
  id?:number
}
const checkProof = async(_id:clickId)=>{
  const data = await request.post('/certificate/updateAudit');
return data
}
const offCProof = async(_id:clickId)=>{
    const data = await request.post('/certificate/updateAudit');
  return data
  }
const updateProof = async(_id:clickId)=>{
    const data = await request.post('/certificate/updateJournal');
  return data
  }
  const redProof = async(_id:clickId)=>{
    const data = await request.post('/certificate/updateJournal');
  return data
  }
  const delProof = async(_id:clickId)=>{
    const data = await request.post('/certificate/updateJournal');
  return data
  }
//   const checkProof = async()=>{
//     const data = await request.post('/certificate/updateAudit');
//   return data
//   }
export {
    findProofList,
    addProof,
    checkProof,
    offCProof,
    updateProof,
    redProof,
    delProof
}